﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin2.master" AutoEventWireup="true" CodeFile="QuanLyThanhVien.aspx.cs" Inherits="Admin_QuanLyThanhVien" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style2
        {
            height: 38px;
        }
        .style3
        {
            height: 38px;
            width: 217px;
        }
        .style5
        {
            height: 38px;
            width: 103px;
        }
        .style7
        {
            height: 50px;
            width: 103px;
        }
        .style8
        {
            height: 50px;
            width: 217px;
        }
        .style9
        {
            height: 25px;
        }
        .style13
        {
            height: 38px;
            width: 479px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <!--<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
        <ContentTemplate>-->
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View1" runat="server">
        <fieldset>
            <legend style="text-align: center; font-size: 18px; font-weight: bold;color:black">
                Quản Lý Nhân Viên </legend>
            <br />
            <table style="margin:0 auto">
            <tr>
                <td align="center" class="style9">
                    <asp:TextBox ID="txttimkiem" runat="server"></asp:TextBox>
                    <asp:DropDownList ID="ddlluachon" runat="server" Width="120px">
                        <asp:ListItem Value="1">Tên Thành Viên</asp:ListItem>
                        <asp:ListItem Value="2">Tên Đăng Nhập</asp:ListItem>
                        <asp:ListItem Value="3">Email</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:Button ID="bttimkiem" runat="server" Text="Tìm Ki&#7871;m" 
                        onclick="bttimkiem_Click" Height="25px" Width="90px" /></td>
            </tr>
          </table>
          <br />
          <div align="center"><asp:GridView ID="gvSanPham" runat="server" AutoGenerateColumns="False" 
                         Width="494px" BorderColor="#D2D2D2" 
                        BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" 
                    AllowSorting="True" CellPadding="2" CellSpacing="3" DataKeyNames="TenDN" 
                    onrowcommand="gvSanPham_RowCommand" 
                    PageSize="5" onpageindexchanging="gvSanPham_PageIndexChanging" 
                onrowdatabound="gvSanPham_RowDataBound" 
                onrowediting="gvSanPham_RowEditing">
                        <Columns>
                            <asp:BoundField DataField="TenDN" HeaderText="Tên Đăng Nhập" 
                                SortExpression="TenDN" />
                            <asp:BoundField DataField="TenNV" HeaderText="Tên Thành Viên" 
                                SortExpression="TenNV" />
                            <asp:BoundField HeaderText="Email" DataField="Email" SortExpression="Email" />
                            <asp:BoundField HeaderText="Chức Vụ" 
                                SortExpression="Quyen" DataField="Quyen" />
                            <asp:TemplateField HeaderText="Chọn">
                                <ItemTemplate>
                                <div style="vertical-align:middle;margin-left:10px;">
                                
                                    <asp:LinkButton ID="LinkButton1" CssClass="btnicon1" runat="server" 
                                        CommandName="Edit" ToolTip="Cập nhật chức vụ" 
                                        CommandArgument='<%# Eval("TenDN") %>'></asp:LinkButton>
                                    
                                    <!--
                                    <asp:LinkButton ID="LinkButton2" CssClass="btnicon2" runat="server" 
                                        CommandName="Delete" 
                                        OnClientClick="return confirm('B&#7841;n c&oacute; ch&#7855;c ch&#7855;n mu&#7889;n x&oacute;a sản phẩm n&agrave;y không?');" 
                                        ToolTip="Xóa sản phẩm"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton3" CssClass="btnicon3" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton4" CssClass="btnicon4" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton5" CssClass="btnicon5" runat="server"></asp:LinkButton>-->
                                    </div>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" 
                            BorderWidth="1px" Font-Bold="True" ForeColor="White" Height="50px" />
                        <PagerStyle CssClass="pagerstyle" />
                        <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />

                    </asp:GridView><br />
              <asp:Label ID="lbKQNhanVien" runat="server" Text="" ForeColor="Red"></asp:Label><br /><br />
              <asp:Button ID="btThemMoi" runat="server" Text="Thêm Mới" Height="25px" 
                  onclick="btThemMoi_Click" Width="90px" /></div>
                    <br />
        </fieldset>

        </asp:View>
        <asp:View ID="View2" runat="server">
        <table align="center" border="0" cellpadding="5" cellspacing="0">
                <tr>
                    <td class="style5">
                        Tên &#272;&#259;ng Nh&#7853;p : </td>
                    
                    <td class="style3">
                        &nbsp;<asp:TextBox ID="txtCustomerID" runat="server" ReadOnly="True" 
                            CssClass="inp-form"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style5">
                        Email : </td>
                    
                    <td class="style3">
                        <asp:TextBox ID="txtEmail0" runat="server" ReadOnly="True" 
                            style="margin-left: 4px" CssClass="inp-form"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style5">
                        Tên Thành Viên : </td>
                    
                    <td class="style3">
                        &nbsp;<asp:TextBox ID="txtFullName" runat="server" 
                            ReadOnly="True" CssClass="inp-form"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style7">
                        Ch&#7913;c V&#7909; : </td>
                    
                    <td class="style8">
                        <asp:DropDownList ID="ddlchucvu" runat="server" Height="24px" Width="100px" >
                            <asp:ListItem Value="NhanVien">Nhân Viên</asp:ListItem>
                            <asp:ListItem Value="QuanTri">Quản Trị</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="style5">
                        </td>
                   
                    <td class="style3">
                        </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" class="style2">
                        <asp:Button ID="btnUpdate" runat="server"
                            Text="C&#7853;p Nh&#7853;t" Width="90px" onclick="btnUpdate_Click" />
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="View3" runat="server">
        <table align="center" border="0" cellpadding="5" cellspacing="0">
                <tr>
                    <td class="style5">
                        Tên Nhân Viên : </td>
                    
                    <td class="style13">
                        &nbsp;<asp:TextBox ID="txtTenNV" runat="server" 
                            CssClass="inp-form"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="txtTenNV" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style5">
                        Số CMND : </td>
                    
                    <td class="style13">
                        <asp:TextBox ID="txtSoCMND" runat="server" 
                            style="margin-left: 4px" CssClass="inp-form"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ControlToValidate="txtSoCMND" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                            ControlToValidate="txtSoCMND" ErrorMessage="Số CMND phải có 9 chữ số" 
                            ForeColor="Red" ValidationExpression="\d{9}"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style5">
                        Địa Chỉ : </td>
                    
                    <td class="style13">
                        &nbsp;<asp:TextBox ID="txtDiaChi" runat="server" 
                            CssClass="inp-form"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ControlToValidate="txtDiaChi" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style5">
                        Số Điện Thoại : </td>
                    
                    <td class="style13">
                        &nbsp;<asp:TextBox ID="txtSoDT" runat="server" CssClass="inp-form"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                            ControlToValidate="txtSoDT" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                            ControlToValidate="txtSoDT" ErrorMessage="Số điện thoại phải có 10 hoặc 11 số" 
                            ForeColor="Red" ValidationExpression="\d{10,11}"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style7">
                        Ch&#7913;c V&#7909; : </td>
                    
                    <td class="style13">
                        &nbsp;<asp:DropDownList ID="DropDownList1" runat="server" Height="25px" 
                            Width="195px" >
                            <asp:ListItem Value="NhanVien">Nhân Viên</asp:ListItem>
                            <asp:ListItem Value="QuanTri">Quản Trị</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="style5">
                        Email : </td>
                    
                    <td class="style13">
                        &nbsp;<asp:TextBox ID="txtEmail" runat="server" 
                            CssClass="inp-form"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                            ControlToValidate="txtEmail" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                            ControlToValidate="txtEmail" 
                            ErrorMessage="Không đúng định dạng Email(abc@yahoo.com)" ForeColor="Red" 
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style5">
                        Tài khoản : </td>
                    
                    <td class="style13">
                        &nbsp;<asp:TextBox ID="txtTaiKhoan" runat="server" 
                            CssClass="inp-form"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                            ControlToValidate="txtTaiKhoan" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:Label ID="lbLoiTK" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style5">
                        Mật Khẩu : </td>
                    
                    <td class="style13">
                        &nbsp;<asp:TextBox ID="txtMK" runat="server" 
                            CssClass="inp-form" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                            ControlToValidate="txtMK" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:Label ID="lbLoiMK" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
                
                <tr>
                    <td class="style5">
                        </td>
                   
                    <td class="style13">
                        </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" class="style2">
                        <asp:Button ID="btThem" runat="server"
                            Text="Thêm" Width="70px" onclick="btThem_Click" />
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    <!--</ContentTemplate>
    </asp:UpdatePanel> -->
</asp:Content>

